package com.cooperate.fly.service.buildDB;

import com.cooperate.fly.bo.Schema;
import com.cooperate.fly.web.Result;

import java.util.ArrayList;

/**
 * Created by Stellar_Lee on 2016/4/17.
 */
public interface BuildSchemaService {

    /**
     * 创建一个schema的节点
     * @param schema
     * @return
     */
    Result createSchemaNode(Schema schema);

    Result deleteSchemaNode(int id);

    Result updateSchemaNode(Schema schema);

    Result searchSchemaNode(Schema schema);

    /**
     * 创建对应数据库表格
     * @param schemaId
     * @return
     */
    Result createSchemaTableBySId(int schemaId);

    Result updateSchemaTable();

    /**
     * 获得数据库所有schema树
     * @return
     */
    String loadSchema();

    Result setDatabase(int schemaId);

    Schema selectSchemaById(int id);

    ArrayList<Schema> selectByParentId(int parentId);

    //获得某个schema下的所有数据构建分支树
    String loadPartSchema(int schemaId);

    String parseSchemaUrl(String path);
    //the same catalog do not allow the same name node
    //if exist the same name node return false
    boolean checkName(Schema schema);

    Result getSchemaRemark3(int schemaId);

    Result setSchemaRemark3(int schemaId,String remark3);

    Result getSchemaInfo(int schemaId);
}
